package pl.edu.amu.wmi.kino.visualjavafx.model.objects.shapes;

import pl.edu.amu.wmi.kino.visualjavafx.model.objects.path.Path;
import java.awt.Color;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import pl.edu.amu.wmi.kino.visualjavafx.model.animation.animationTime.Timeline;



// <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
import pl.edu.amu.wmi.kino.visualjavafx.model.objects.VisualObject;
// #[regen=yes,id=DCE.AA5EE7D6-0B47-C426-63D2-448D9ACEE9BB]
// </editor-fold> 
public class Elipse implements Shape ,java.io.Serializable{

    // Code block for changeListeners support start
    protected PropertyChangeSupport propertySupport= new PropertyChangeSupport(this);
    @Override
    public void addPropertyChangeListener(PropertyChangeListener listener) {
        propertySupport.addPropertyChangeListener(listener);
    }
    @Override
    public void removePropertyChangeListener(PropertyChangeListener listener) {
        propertySupport.removePropertyChangeListener(listener);
    }
    // Code block for changeListeners support end


    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.9FC31B83-9F65-CD5F-0FAF-081DC0EF9924]
    // </editor-fold> 
    public Elipse () {
    }


    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.BA59599C-48B5-357F-AD5F-417DD8A847B7]
    // </editor-fold> 
    @Override
    public double getHPos () {
        return this.hPos;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.9517C8D9-C678-9FAF-9A85-9456C5B64684]
    // </editor-fold> 
    @Override
    public void setHPos (double val) {
        double oldVal = this.hPos;
        this.hPos=val;
        propertySupport.firePropertyChange( "hPos" , new Double(oldVal), new Double(val));
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.33D2F94A-1BB6-DEB5-6681-235042ADF70A]
    // </editor-fold> 
    @Override
    public double getVPos () {
        return this.vPos;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.050D8909-A474-34ED-13FF-8024266A1138]
    // </editor-fold> 
    @Override
    public void setVPos (double val) {
        double oldVal = this.vPos;
        this.vPos=val;
        propertySupport.firePropertyChange( "vPos" , new Double(oldVal), new Double(val));
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.CC62CF5F-6818-6B44-72B0-4E87856D1F49]
    // </editor-fold> 
    @Override
    public double getRotation () {
        return this.rotation;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.C3153AFE-F369-636B-5027-82F6053DC58D]
    // </editor-fold> 
    @Override
    public void setRotation (double val) {
        double oldVal = this.rotation;
        this.rotation=val;
        propertySupport.firePropertyChange( "rotation" , new Double(oldVal), new Double(val));
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.5072F075-0BBB-B845-3117-DAE173801250]
    // </editor-fold> 
    @Override
    public double getVCenterDelta () {
        return this.vCenterDelta;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.106F1976-4965-3F5E-2835-1BEB34FDF886]
    // </editor-fold> 
    @Override
    public void setVCenterDelta (double val) {
        double oldVal = this.vCenterDelta;
        this.vCenterDelta=val;
        propertySupport.firePropertyChange( "vCenterDelta" , new Double(oldVal), new Double(val));
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.43566319-7F89-2FBB-AB95-A4C9626FEA8B]
    // </editor-fold> 
    @Override
    public double getHCenterDelta () {
        return this.hCenterDelta;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.6E1874C4-5413-E766-14C2-68F4A97EA457]
    // </editor-fold> 
    @Override
    public void setHCenterDelta (double val) {
        double oldVal = this.hCenterDelta;
        this.hCenterDelta=val;
        propertySupport.firePropertyChange( "hCenterDelta" , new Double(oldVal), new Double(val));
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.B259F1B0-B530-1BE9-C5E9-3C9F1D712373]
    // </editor-fold> 
    @Override
    public double getSizeH () {
        return this.hSize;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.12094764-D63A-5490-B36A-945F433D3F1B]
    // </editor-fold> 
    @Override
    public void setSizeH (double val) {
        double oldVal = this.hSize;
        this.hSize=val;
        propertySupport.firePropertyChange( "hSize" , new Double(oldVal), new Double(val));
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.5D04CCF3-205A-3935-09C8-DF51E87EDE3C]
    // </editor-fold> 
    @Override
    public double getSizeV () {
        return this.vSize;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.16D95A5D-A1CC-12F6-3564-3BE065A1F2BC]
    // </editor-fold> 
    @Override
    public void setSizeV (double val) {
        double oldVal = this.vSize;
        this.vSize=val;
        propertySupport.firePropertyChange( "vSize" , new Double(oldVal), new Double(val));
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.563BDD0A-7931-F9D6-5024-DBD25533FBCD]
    // </editor-fold> 
    @Override
    public double getBorderWidth () {
        return this.borderWidth;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.918A0A66-827E-F75F-BEAC-F1A8F0BD8782]
    // </editor-fold> 
    @Override
    public void setBorderWidth (double val) {
        double oldVal = this.borderWidth;
        this.borderWidth=val;
        propertySupport.firePropertyChange( "borderWidth" , new Double(oldVal), new Double(val));
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.1259D7DF-D7C3-E146-0604-1E7E64D361D6]
    // </editor-fold> 
    @Override
    public double getOpacity () {
        return this.opacity;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.DCBE6E41-1F2F-8A96-EF35-0211849C813C]
    // </editor-fold> 
    @Override
    public void setOpacity (double val) {
        double oldVal = this.opacity;
        this.opacity=val;
        propertySupport.firePropertyChange( "opacity" , new Double(oldVal), new Double(val));
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.40F535C8-2943-08BB-6567-474C496C7FBD]
    // </editor-fold> 
    @Override
    public double getHShear () {
        return hShear;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.8A5D48F3-3F38-152D-9A3E-0C7AE7AD8B27]
    // </editor-fold> 
    @Override
    public void setHShear (double val) {
        double oldVal = this.hShear;
        this.hShear=val;
        propertySupport.firePropertyChange( "hShear" , new Double(oldVal), new Double(val));
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.115D5B55-B0CE-1412-8314-19C5E3EB1C01]
    // </editor-fold> 
    @Override
    public double getVShear () {
        return vShear;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.0BABBD87-A562-C411-4BDF-48B59A47EB35]
    // </editor-fold> 
    @Override
    public void setVShear (double val) {
        double oldVal = this.vShear;
        this.vShear=val;
        propertySupport.firePropertyChange( "vShear" , new Double(oldVal), new Double(val));
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.AA821091-78D3-D816-C8DE-ADD414D6F3BB]
    // </editor-fold> 
    @Override
    public Path toPath () {
        return null;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.6D7A51D9-9042-1763-A1C1-84FBF8684876]
    // </editor-fold> 
    @Override
    public Color getBorderColor () {
        return borderColor;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.F069D7F7-5760-0768-75B9-B2C92B642D45]
    // </editor-fold> 
    @Override
    public void setBorderColor (Color val) {
        Color oldVal = this.borderColor;
        this.borderColor=val;
        propertySupport.firePropertyChange( "borderColor" , oldVal, val);
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.2FA0FB86-9B83-045B-C88D-A529CD2742F5]
    // </editor-fold> 
    @Override
    public Color getFillColor () {
        return this.fillColor;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.D7C9B5F5-8F36-D885-00E8-07BEC04E5D6B]
    // </editor-fold> 
    @Override
    public void setFillColor (Color val) {
        Color oldVal = this.fillColor;
        this.fillColor=val;
        propertySupport.firePropertyChange( "fillColor" , oldVal, val);
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.B5D0AEBE-45AF-07AA-F937-51FD21B83950]
    // </editor-fold> 
    @Override
    public void setVisibility (boolean val) {
        boolean oldVal = this.visible;
        this.visible=val;
        propertySupport.firePropertyChange( "visible" , new Boolean(oldVal), new Boolean(val));
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.F16F8308-EA7B-DC22-5FF6-C72A0AD989F7]
    // </editor-fold> 
    @Override
    public boolean getVisibility () {
        return this.visible;
    }

    @Override
    public Timeline getTimeline() {
        return this.timeline;
    }

    //TODO : Grzegorz : figure out how standard clone works on this and modify it 
    @Override
    public VisualObject shallowClone(){
        Elipse res = new Elipse();
        res.hPos=this.hPos;
        res.vPos=this.vPos;
        res.rotation=this.rotation;
        res.vCenterDelta=this.vCenterDelta;
        res.hCenterDelta=this.hCenterDelta;
        res.vSize=this.vSize;
        res.hSize=this.hSize;
        res.opacity=this.opacity;
        res.hShear=this.hShear;
        res.vShear=this.vShear;
        res.borderColor=new Color(this.borderColor.getRGB());
        res.fillColor=new Color(this.fillColor.getRGB());
        res.visible=this.visible;
        return res;
    }


    private double hPos = 0 ;
    private double vPos = 0 ;
    private double rotation = 0 ;
    private double vCenterDelta = 0 ;
    private double hCenterDelta = 0 ;
    private double vSize = 10;
    private double hSize = 20;
    private double borderWidth = 1;
    private double opacity = 1;
    private double hShear = 0;
    private double vShear = 0;
    private Color borderColor = new Color(0,0,0) ;
    private Color fillColor = new Color(255,255,255) ;
    private boolean visible = true;
    private Timeline timeline = new Timeline();
}

